<?php

use think\migration\Seeder;

class Store extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
      $faker = Faker\Factory::create('zh_CN');

      $data = [];

      for ($i=0; $i <100 ; $i++) {

        $data[] = [
                  'code'          => $faker->numberBetween(10000,99999),
                  'name'          => $faker->sentence,
                  'location'      => $faker->address,

                  'remark'        => $faker->text,

                  'create_at'     => date('Y-m-d H:i:s'),
                  'update_at'     => date('Y-m-d H:i:s'),
              ];
      }



      $table = $this->table('store');

      $table->insert($data)
            ->save();

    }
}
